<!DOCTYPE html>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="stylesheet" href="./lib/layui/css/layui.css">
  <link rel="stylesheet" href="./css/advimg.css">
  <link rel="stylesheet" href="./css/font-awesome.css">
  <link rel="stylesheet" href="./css/font.css">
  <link rel="stylesheet" href="./css/xadmin.css">
  <script src="./lib/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="./js/xadmin.js"></script>
  <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>

<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">首页</a>
      <a href="">演示</a>
      <a>
        <cite>导航元素</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
      onclick="location.reload()" title="刷新">
      <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
  </div>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15 ">
      <form class="layui-form" action="" id="form_pub">
        <!-- 文章标题 -->
        <div class="layui-form-item">
          <label class="layui-form-label">广告图描述</label>
          <div class="layui-input-block">
            <input type="text" name="advimgdesc" required lay-verify="required" placeholder="请输入广告位名称"
              autocomplete="off" class="layui-input">
          </div>
        </div>
        <!-- 文章列表 -->
        <div class="layui-form-item">
          <label class="layui-form-label">广告图位置</label>
          <div class="layui-input-block">
            <select name="advimgpos" lay-verify="required" id="selectList">
              <option value="">请选择广告位</option>
            </select>
          </div>
        </div>
        <div class="layui-form-item">

          <button class="layui-btn search" lay-submit lay-filter="formDemo"><i class="fa fa-search"
              aria-hidden="true"></i>搜索</button>
          <button type="reset" class="layui-btn layui-btn-primary"><i class="fa fa-refresh"
              aria-hidden="true"></i>重置</button>

        </div>
        <br>
        <div class="layui-form-item download">

          <button class="layui-btn add" lay-submit lay-filter="formDemo"><i class="fa fa-plus-square-o"
              aria-hidden="true"></i>新增</button>
          <button type="reset" class="layui-btn layui-btn-primary"><i class="fa fa-arrow-down"
              aria-hidden="true"></i>导出</button>

        </div>
      </form>
      <table class="layui-table">
        <colgroup>
          <col width="14px">
          <col width="14px">
          <col>
          <col>
          <col>
        </colgroup>
        <thead>
          <tr>
            <th> <input type="checkbox" name="like" title="id"></th>
            <th>#</th>
            <th>广告图位</th>
            <th>广告图描述</th>
            <th>广告图</th>
            <th>广告链接</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>

        </tbody>
      </table>
      <div id="page-box"></div>
    </div>
  </div>
  <script type="text/html" id="tpl_advimg">
    {{each data.data}}
    <tr>
  <td><input type="checkbox"></td>
  <td>{{$value.id}}</td>
  <td>{{$value.advimgpos}}</td>
  <td>{{$value.advimgdesc}}</td>
 
  <td>
    <img src="http://124.223.14.236:8060/{{$value.advimgsrc}}" alt="">
  </td>
  <td>{{$value.advimglink}}</td>
  <td>
    <button type="button" class="layui-btn layui-btn-xs" data-id="{{$value.id}}" id="editBtn"><i
      class="fa fa-pencil" aria-hidden="true"></i></button>
  <button type="button" class="layui-btn layui-btn-danger layui-btn-xs" data-id="{{$value.id}}"
    id="btnDel"><i class="fa fa-trash" aria-hidden="true"></i></button>
  </td>
</tr>
  {{/each}}
  </script>
  <!-- 渲染广告位 -->
  <script type="text/html" id="renderPos">
    <option value=""></option>
    {{each data.data}}
    <option value="{{$value.id}}">{{$value.advposname}}</option>
    {{/each}}
  </script>
  <!-- 编辑 -->
  <script type="text/html" id="tpl-EditAdv">
  <form class="layui-form" action="" lay-filter="formedit" id="formedit">
    <div class="layui-form-item advpos">
      <label class="layui-form-label">广告位</label>
      <div class="layui-input-block" id="select" >
        <select lay-verify="required" name="advimgpos">
        
        </select>
      </div>
    </div>
    <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">广告图描述</label>
      <div class="layui-input-block">
        <textarea name="advimgdesc" placeholder="请输入内容" class="layui-textarea"></textarea>
      </div>
    </div>
    <div class="layui-form-item advlink">
      <label class="layui-form-label">广告图链接</label>
      <div class="layui-input-block">
        <input type="text" name="advimglink" required lay-verify="required" placeholder="请输入标题" autocomplete="off"
          class="layui-input">
      </div>
    </div>
    <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">广告图</label>
     
        <div class="layui-input-block imgbigbox">
     <img src="" alt="" id="img">
   
    </div>
   
      </div>
    <div class="layui-form-item button">
      <div class="layui-input-block">
        <button class="layui-btn layui-btn-primary" >取消</button>
        <button type="reset" class="layui-btn updateBtn" lay-submit lay-filter="formedit">确定</button>
      </div>
    </div>
    
  </form>

  </script>
  <!-- 新增 -->
  <script type="text/html" id="tpl-addAdv">
    <form class="layui-form" action="" lay-filter="formAdd" id="formAdd">
      <input type="file" hidden id="file" name="advimgsrc">
      <div class="layui-form-item advpos">
        <label class="layui-form-label">广告位</label>
        <div class="layui-input-block">
          <select lay-verify="required" id="Addselect" name="advimgpos">
            <option value="">请选择广告位</option>
          </select>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">广告图描述</label>
        <div class="layui-input-block">
          <textarea name="advimgdesc" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item advlink">
        <label class="layui-form-label">广告图链接</label>
        <div class="layui-input-block">
          <input type="text" name="advimglink" required lay-verify="required" placeholder="请输入标题" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">广告图</label>
        
          <div class="imgbox">  
            <button type="button" class="layui-btn"  id="uploadfile">点击上传</button>
          </div>
         
      
      </div>
      <div class="layui-form-item button">
        <div class="layui-input-block">
          <button class="layui-btn layui-btn-primary" >取消</button>
          <button type="reset" class="layui-btn" lay-submit lay-filter="formDemo" id="confirmbutton">确定</button>
        </div>
      </div>
    </form>
  </script>
  <script src="./lib/layui/layui.js"></script>
  <script src="./js/jquery.min.js"></script>
  <script src="./lib/layui/layui.all.js"></script>
  <script src="./lib/template-web.js"></script>
  <script src="./js/advimg.js"></script>

</body>

</html>